package wjw.mapper;

import com.wjw.mapper.DamageTypeStableMapper;
import com.wjw.model.Damage_type_stable;
import com.wjw.utils.GetSqlSessionUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

public class DamageTypeStable {

    private SqlSession sqlsession= GetSqlSessionUtils.getSqlSession();
    private DamageTypeStableMapper mapper=sqlsession.getMapper(DamageTypeStableMapper.class);

    @Test
    public void test01(){
        List<Damage_type_stable> all = mapper.findAll();
        System.out.println(all);
    }

    @Test
    public void test02(){
        Damage_type_stable damage_type_stable = new Damage_type_stable();
        damage_type_stable.setDamage_type_fid(2);
        damage_type_stable.setDamage_type_calcu("dada");
        damage_type_stable.setDamage_type_shape("奇怪");
        damage_type_stable.setDamage_type_sname("裂缝");
        mapper.add(damage_type_stable);
        sqlsession.commit();
    }

    @Test
    public void test03(){
        Damage_type_stable damage_type_stable = new Damage_type_stable();
        damage_type_stable.setDamage_type_fid(2);
        damage_type_stable.setDamage_type_calcu("dada");
        damage_type_stable.setDamage_type_shape("不奇怪");
        damage_type_stable.setDamage_type_sname("裂缝");
        damage_type_stable.setDamage_type_sid(2);
        mapper.change(damage_type_stable);
        sqlsession.commit();
    }
}
